import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/alarm/get_alarm_type_entity.dart';

GetAlarmTypeEntity $GetAlarmTypeEntityFromJson(Map<String, dynamic> json) {
  final GetAlarmTypeEntity getAlarmTypeEntity = GetAlarmTypeEntity();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    getAlarmTypeEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    getAlarmTypeEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    getAlarmTypeEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    getAlarmTypeEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    getAlarmTypeEntity.deleted = deleted;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    getAlarmTypeEntity.id = id;
  }
  final String? model = jsonConvert.convert<String>(json['model']);
  if (model != null) {
    getAlarmTypeEntity.model = model;
  }
  final int? num = jsonConvert.convert<int>(json['num']);
  if (num != null) {
    getAlarmTypeEntity.num = num;
  }
  final String? typeName = jsonConvert.convert<String>(json['typeName']);
  if (typeName != null) {
    getAlarmTypeEntity.typeName = typeName;
  }
  return getAlarmTypeEntity;
}

Map<String, dynamic> $GetAlarmTypeEntityToJson(GetAlarmTypeEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['model'] = entity.model;
  data['num'] = entity.num;
  data['typeName'] = entity.typeName;
  return data;
}

extension GetAlarmTypeEntityExtension on GetAlarmTypeEntity {
  GetAlarmTypeEntity copyWith({
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    int? id,
    String? model,
    int? num,
    String? typeName,
  }) {
    return GetAlarmTypeEntity()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..model = model ?? this.model
      ..num = num ?? this.num
      ..typeName = typeName ?? this.typeName;
  }
}
